"use strict";

const Controller = require("egg").Controller;

class ManagementController extends Controller {
  async attencedata() {
    this.ctx.body = {
      late: 2,
      early: 1,
      holiday: 2,
      out: 5
    };
  }

  async getmembers() {
    this.ctx.body = [
      {
        id: "1",
        username: "小明",
        age: 21,
        gender: "男",
        position: "软件开发"
      },
      {
        id: "2",
        username: "小刚",
        age: 22,
        gender: "男",
        position: "软件开发"
      },
      {
        id: "3",
        username: "莉莉",
        age: 19,
        gender: "女",
        position: "人事"
      },
      {
        id: "4",
        username: "小红",
        age: 20,
        gender: "女",
        position: "财务"
      },
      {
        id: "5",
        username: "小西",
        age: 31,
        gender: "女",
        position: "UI设计"
      },
      {
        id: "6",
        username: "小强",
        age: 27,
        gender: "男",
        position: "软件开发"
      },
      { id: "7", username: "小为", age: 34, gender: "男", position: "测试" },
      {
        id: "8",
        username: "小微",
        age: 25,
        gender: "女",
        position: "UI设计"
      }
    ];
  }

  async getMembers() {
    this.ctx.body = [
      { id: "1", username: "Jerry", age: 21, gender: "male" },
      { id: "2", username: "Tomy", age: 22, gender: "male" },
      { id: "3", username: "Lily", age: 19, gender: "female" },
      { id: "4", username: "Lucy", age: 20, gender: "female" }
    ];
  }
  async deleteMember() {
    this.ctx.body = {
      code: "1000",
      msg: "success"
    };
  }
  async recommend() {
    this.ctx.body = [
      {
        title: "怎么在一个月内让英语听力有明显的提高？",
        answer:
          "一切需要耗费太多意志力支撑的方法都不是好方法。这道题下面已经有很多回答，但一来方法需要,占用的时间太多，耗费大量不必要的意志力，二来步骤不太清晰，容易导致同学们执行的时候有些困惑。"
      },
      {
        title: "哪些资料堪称英专学生的神器？",
        answer:
          "你可以试试播客、podcast，听外国人的英语，你做影子练习shadowing，他们说什么，你就跟着说什么，或者掐表固定一段时间，例如3Min实时翻译。"
      },
      {
        title: "超强的学习能力是怎样练就的？",
        answer:
          "下面是我列举的大部分人学习效率不高的常见状态，看看：经常重复阅读，也就是死记硬背,很少回顾当天学习过的知识,碰到不懂的题目，很少努力去思考，经常的状态是，稍微思考一下，脑子反应不出来，就去翻看答案。"
      }
    ];
  }
}

module.exports = ManagementController;
